import {Component, OnInit} from '@angular/core';
import {Router, NavigationExtras} from '@angular/router';

@Component({
  selector: 'app-detail3',
  templateUrl: './detail3.component.html',
  styleUrls: ['./detail3.component.scss']
})
export class Detail3Component implements OnInit {

  constructor(public route: Router) {
  }

  ngOnInit(): void {
  }

  goHome() {  // 普通路由
    this.route.navigate(['/home']);
  }

  goDetail2() { // 动态路由
    this.route.navigate(['/detail2', 100]);
  }

  goDetail() { // get路由传值
    let queryParams: NavigationExtras = {
      queryParams: {'id': 123}
    };
    this.route.navigate(['/detail'], queryParams);
  }
}
